home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Spicy Pics!
/
Spicy Pics!.iso
/
amiga
/
gifmachn
/
sources
/
doflip.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-18
|
2KB
|
75 lines
/* Copyright 1990 by Christopher A. Wichura.
See file GIFMachine.doc for full description of rights.
*/
#include "GIFMachine.h"
extern struct GIFdescriptor gdesc;
EXTERNBITPLANE;
extern char *AbortMsg;
extern BOOL DisplayCounts;
void DoXFlip(void)
{
register UWORD x1;
register UWORD x2;
register UWORD y;
struct RGB TempColourStore;
MyPrintf("...Flipping image %s.\n......%s ", "horizontally", (DisplayCounts ? "Line" : "Working\x1B[1D"));
for (y = 0; y < gdesc.gd_Height; y++) {
if (DisplayCounts)
MyPrintf("%5ld", y);
for (x1 = 0, x2 = gdesc.gd_Width - 1; x1 < x2; x1++, x2--) {
TempColourStore = BitPlane[y][x1];
BitPlane[y][x1] = BitPlane[y][x2];
BitPlane[y][x2] = TempColourStore;
}
if (SetSignal(0L, SIGBREAKF_CTRL_C) & SIGBREAKF_CTRL_C) {
MyPrintf("\n%s", AbortMsg);
MyExit(ABORTEXITVAL);
}
if (DisplayCounts)
PutStr("\x1B[5D");
}
MyPrintf("\x1B[%ldDFlipped. \n", (DisplayCounts ? 5 : 7));
}
void DoYFlip(void)
{
register UWORD y1;
register UWORD y2;
register UWORD x;
struct RGB TempColourStore;
MyPrintf("...Flipping image %s.\n......%s ", "vertically", (DisplayCounts ? "Column" : "Working\x1B[1D"));
for (x = 0; x < gdesc.gd_Width; x++) {
if (DisplayCounts)
MyPrintf("%5ld", x);
for (y1 = 0, y2 = gdesc.gd_Height - 1; y1 < y2; y1++, y2--) {
TempColourStore = BitPlane[y1][x];
BitPlane[y1][x] = BitPlane[y2][x];
BitPlane[y2][x] = TempColourStore;
}
if (SetSignal(0L, SIGBREAKF_CTRL_C) & SIGBREAKF_CTRL_C) {
MyPrintf("\n%s", AbortMsg);
MyExit(ABORTEXITVAL);
}
if (DisplayCounts)
PutStr("\x1B[5D");
}
MyPrintf("\x1B[%ldDFlipped. \n", 7);
}